package top.fullj.remoting.message;

import com.google.common.base.MoreObjects;

import java.io.Serializable;

/**
 * @author bruce.wu
 * @since 2022/2/14 11:16
 */
public class InvokeRequest implements Serializable {

    private static final long serialVersionUID = -3247350167734466528L;

    private String service;

    private String method;

    private Object[] args;

    private Class<?>[] types;

    public InvokeRequest() {

    }

    public InvokeRequest(String serviceName, String methodName, Object[] args, Class<?>[] types) {
        this.service = serviceName;
        this.method = methodName;
        this.args = args;
        this.types = types;
    }

    public String getService() {
        return service;
    }

    public String getMethod() {
        return method;
    }

    public Object[] getArgs() {
        return args;
    }

    public Class<?>[] getTypes() {
        return types;
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
                .add("service", service)
                .add("method", method)
                .add("args", args)
                .add("types", types)
                .toString();
    }

}
